package com.anjubao.parking.municipal.roadside.controller;

import com.anjubao.parking.municipal.roadside.utils.DateUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/time")
public class TimeController {

    @GetMapping("/getCurrentTime")
    public String getCurrentTime(){
        String dateStr= DateUtils.getDateStr(new Date());
        return dateStr.substring(0,4)+dateStr.substring(5,7)+dateStr.substring(8,10)+" "+dateStr.substring(11);
    }
}
